package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.service.GoodsTypeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/goodsType")
public class GoodsTypeController {
    @Resource
    private GoodsTypeService goodsTypeService;
    @PostMapping("/loadGoodsType")
    private String getAllGoodsType(){
        return goodsTypeService.getAllGoodsType();
    }

    @PostMapping("/save")
    public ServiceVO saveGoodsType(String  goodsTypeName, Integer  pId){
        return goodsTypeService.saveGoodsType(goodsTypeName, pId);
    }

    @PostMapping("/delete")
    public ServiceVO deleteGoodsType(Integer  goodsTypeId){

        return goodsTypeService.deleteGoodsType(goodsTypeId);
    }

}
